package bpm.dao.impl.document;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import bpm.domain.document.FieldConstraint;

/**
 * 
 * @author <a mailto="hwangsyin@gmail.com">King</a>
 *
 */
public class FieldConstraintMapper implements RowMapper {

	public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
		FieldConstraint constraint = new FieldConstraint();
		
		constraint.setId(rs.getInt("id"));
		constraint.setWriteFormat(rs.getInt("write_format"));
		constraint.setDocumentDefinitionId(rs.getInt("docdef_id"));
		constraint.setFieldId(rs.getInt("field_id"));
		constraint.setProcessDefinitionId(rs.getString("procdef_id"));
		constraint.setNodeId(rs.getString("node_id"));
		constraint.setDescription(rs.getString("description"));
		
		return constraint;
	}

}
